/*
 * Copyright (c) 2002-2004, xRhino, Inc.
 *
 * This library is free software; you can redistribute and/or modify
 * it under the terms of the dual license distributed with this source
 * package (a combined Trolltech QPL/GPL-compatible license)
 *
 * Under this dual license scheme, a separate license is available for use of 
 * this code with a proprietary (closed) system. For more information on the 
 * license, please see the LICENSE file distributed with this source package.
 */
#ifndef SUGCOLOR_H
#define SUGCOLOR_H

#include "SugTypes.h"
#include <string>

using namespace std;

/**
 * This class represents the a color in the sugar enviornment.
 */
class SugColor
{
  protected:
   /**
    * The color value.
    */
   SugRealType mRGB[3];
    
 public:
   /**
    * Returns the red variable.
    */
   SugRealType getRed();

   /**
    * Returns the green variable.
    */
   SugRealType getGreen();

   /**
    * Returns the blue variable.
    */
   SugRealType getBlue();

   /**
    * Stores the RGB value of this color in the three SugRealType
    * variables.
    */
   void getRGB(SugRealType& r, SugRealType& g, SugRealType& b);
   
   /**
    * Sets the RGB value of this color from the three SugRealType
    * variables.
    */
   void setRGB(SugRealType r, SugRealType g, SugRealType b);

   /**
    * Sets the x variable.
    */
   void setColor(const char* colorStr);

   /**
    * Operator overloader to cast this class as a vector of floats.
    */
   operator SugRealType*();

   /**
    * The class constructor.  
    */
   SugColor();

   /**
    * The class destructor.
    */
   ~SugColor();

 protected:
   /**
    * Adds a color to the color alias mappings.
    *
    * @param colorName the name of the color being added
    * @param colorValue the value of the color begin added
    */
   void addColorAlias(string colorName, unsigned int colorValue);
};

#endif
